package com.hongxun.project.tool.assets;

import com.hongxun.common.utils.bean.BeanUtils;
import com.hongxun.project.assets.iBoxes.domain.IBoxes;
import com.hongxun.project.assets.iCablePit.domain.ICablePit;
import com.hongxun.project.assets.iDevice.domain.IDevice;
import com.hongxun.project.assets.iMaterial.domain.IMaterial;
import com.hongxun.project.assets.iPicture.domain.IPicture;
import com.hongxun.project.assets.iPole.domain.IPole;
import com.hongxun.project.assets.iPullLine.domain.IPullLine;
import com.hongxun.project.assets.pBoxes.domain.PBoxes;
import com.hongxun.project.assets.pCablePit.domain.PCablePit;
import com.hongxun.project.assets.pDevice.domain.PDevice;
import com.hongxun.project.assets.pMaterial.domain.PMaterial;
import com.hongxun.project.assets.pPicture.domain.PPicture;
import com.hongxun.project.assets.pPole.domain.PPole;
import com.hongxun.project.assets.pPullLine.domain.PPullLine;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by admin on 2019/3/28.
 */
public class P2IUtils {

    public static List<IBoxes> getBoxes(List<PBoxes> iBoxes) {
        List<IBoxes> pBoxes = new ArrayList<>();
        for (PBoxes i : iBoxes) {
            IBoxes p = new IBoxes();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

    public static List<ICablePit> getCablePit(List<PCablePit> iBoxes) {
        List<ICablePit> pBoxes = new ArrayList<>();
        for (PCablePit i : iBoxes) {
            ICablePit p = new ICablePit();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

    public static List<IDevice> getDevice(List<PDevice> iBoxes) {
        List<IDevice> pBoxes = new ArrayList<>();
        for (PDevice i : iBoxes) {
            IDevice p = new IDevice();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

    public static List<IMaterial> getMaterial(List<PMaterial> iBoxes) {
        List<IMaterial> pBoxes = new ArrayList<>();
        for (PMaterial i : iBoxes) {
            IMaterial p = new IMaterial();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

    public static List<IPole> getPole(List<PPole> iBoxes) {
        List<IPole> pBoxes = new ArrayList<>();
        for (PPole i : iBoxes) {
            IPole p = new IPole();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

    public static List<IPicture> getPicture(List<PPicture> iBoxes) {
        List<IPicture> pBoxes = new ArrayList<>();
        for (PPicture i : iBoxes) {
            IPicture p = new IPicture();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

    public static List<IPullLine> getPullLine(List<PPullLine> iBoxes) {
        List<IPullLine> pBoxes = new ArrayList<>();
        for (PPullLine i : iBoxes) {
            IPullLine p = new IPullLine();
            BeanUtils.copyBeanProp(p, i);
            pBoxes.add(p);
        }
        return pBoxes;
    }

}
